import { Component, OnDestroy } from '@angular/core';
import { AppMainComponent } from './app.main.component';
import { Subscription } from 'rxjs';
import { MenuItem } from 'primeng/api';
import { Store } from '@ngrx/store';
import { setUser } from './store/user/user.actions';
//import { Logout } from './store/user/user.effects';

@Component({
    selector: 'app-topbar',
    templateUrl: './app.topbar.component.html'
})
export class AppTopBarComponent {

    items: MenuItem[];
    menuItems: MenuItem[];
    constructor(public appMain: AppMainComponent,private store:Store) { }
    onClick(){
        localStorage.removeItem('user')
        this.store.dispatch(setUser({user:{username:undefined,token:undefined,auth:undefined,menus:'ssss'}}))
        //Logout()
    }
}
